﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>{% block title %}nasze sprawki{% endblock %}</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="/media/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.3.min.js"></script> 
</head>
<body>
<!-- start header -->
<div id="header">
	<div id="logo">
		<h1><a href="/">nasze sprawki<sup></sup></a></h1>
		<h2>developed by dCode</h2>
	</div>
	<div id="menu">
		<ul>
			<li class="active"><a href="/">strona główna</a></li>
			<li><a href="/about/">o nas</a></li>
			<li><a href="/about/contact">kontakt</a></li>
            {% if user.is_authenticated %}
                <li><a href="#">Witaj, {{ user.username }}</a></li>
            {% else %}
                <li><a href="#">loguj</a></li>
            {% endif %}
            
		</ul>
	</div>
</div>
<!-- end header -->
<div id="showcase"></div>
<!-- start page -->
<div id="page">
    {% block before_content %}
    {% endblock %}
	<!-- start content -->   
	<div id="content">   
    {% load comments %}   
    {% load plugins %} 
    {% block content %}      
        {% for announcement in announcements.object_list %}
        <div class="post">
            <h2 class="title">{{ announcement.location.name }}, tu <a href="{% url myapp.views.user announcement.user.username %}">{{ announcement.user.username }} </a></h2>
            <p class="date">{{ announcement.pub_date|date:'M'}}<b>{{ announcement.pub_date|date:'d'}}</b></p>
            <strong>{{ announcement.votes }} głos{{ announcement.votes|pluralize }}</strong>
            <div class="entry">
                <p>{{ announcement.text }}</p>
            </div>            
            <div class="meta">
                {% get_comment_count for announcement as comment_count %}
                {% if comment_count > 0 %}
                    <div class="comments">{% render_comment_list for announcement %}</div>
                {% endif %}
                <div style="display:none" id={{ announcement.id }}>
                {% render_comment_form for announcement %}
                </div>
                <p class="links">
                    <a href="#" class="more">dodaj komentarz</a>
                    <a href="/announcement-vote-add/{{ announcement.id }}" class="more">fajne</a>
                </p>
            </div>
        </div>
        {% endfor %}
        {% block before_pagination %}  
            <div class="post">
                <div class="meta">
                    <a href="{% url myapp.views.announcement_add %}" class="more">dodaj ogłoszenie</a>
                </div>
            </div>        
        {% endblock %}
        <div class="pagination">
            <span class="step-links">
                {% if announcements.has_previous %}
                    <a href="?page={{ announcements.previous_page_number }}">poprzednia</a>
                {% endif %}

                <span class="current">
                    Strona {{ announcements.number }} z {{ announcements.paginator.num_pages }}.
                </span>

                {% if announcements.has_next %}
                    <a href="?page={{ announcements.next_page_number }}">następna</a>
                {% endif %}
            </span>
        </div>
    {% endblock %}
	</div>
	<!-- end content -->
	<!-- start sidebar -->
	<div id="sidebar">
    {% block sidebar %}
        {% load mptt_tags %}
		<ul>
			<li id="search">
				<h2><b class="text1">Szukaj</b></h2>
				<form method="get" action="/search/">
					<fieldset>
					<input type="text" id="q" name="q" value="" />
					<input type="submit" id="x" value="Szukaj" />
					</fieldset>
				</form>
			</li>
			<li>
				<h2><strong>Wasze</strong> miejsca</h2>
                <ul class="root">
                    {% recursetree locations %}
                        <li>
                            <a href="{% url myapp.views.location node.slug %}">{{ node.name }}</a>
                            {% if not node.is_leaf_node %}
                                   <i> {{ children }} </i>
                            {% endif %}
                        </li>
                    {% endrecursetree %}
                </ul>
			</li>
		</ul>
    {% endblock %}        
	</div>
	<!-- end sidebar -->
	<div style="clear: both;">&nbsp;</div>
</div>
<!-- end page -->
<!-- start footer -->
<div id="footer">
	<div id="footer-menu">
		<ul>
			<li class="active"><a href="/">strona główna</a></li>
			<li><a href="/about/">o nas</a></li>
			<li><a href="#">linki</a></li>
			<li><a href="/about/contact">kontakt</a></li>
		</ul>
	</div>
	<p id="legal">(c) 2008 YourSite. Design by <a href="http://www.freecsstemplates.org/">Free CSS Templates</a>.</p>
</div>
<!-- end footer -->
</body>
</html>
